Define DryRunnable#dry_run?

A dry-runnable Agent can use this method to decide if it should avoid
affecting unsandboxed resources, like calling an external API that
might change any state.

Akinori MUSHA %!s(int64=9) %!d(string=hace) años
padre
commit
40d6192070
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      app/concerns/dry_runnable.rb

+ 4 - 0
app/concerns/dry_runnable.rb

@@ -25,6 +25,10 @@ module DryRunnable
25 25
     )
26 26
   end
27 27
 
28
+  def dry_run?
29
+    is_a? Sandbox
30
+  end
31
+
28 32
   module Sandbox
29 33
     attr_accessor :results
30 34